VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLStructuredDataWriter.h 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 =========================================================================*/ 00022 #ifndef vtkXMLStructuredDataWriter_h 00023 #define vtkXMLStructuredDataWriter_h 00024 00025 #include "vtkIOXMLModule.h" // For export macro 00026 #include "vtkXMLWriter.h" 00027 00028 class vtkAbstractArray; 00029 class vtkInformation; 00030 class vtkInformationVector; 00031 00032 class VTKIOXML_EXPORT vtkXMLStructuredDataWriter : public vtkXMLWriter 00033 { 00034 public: 00035 vtkTypeMacro(vtkXMLStructuredDataWriter,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 00059 00062 vtkSetVector6Macro(WriteExtent, int); 00063 vtkGetVector6Macro(WriteExtent, int); 00065 00066 protected: 00067 vtkXMLStructuredDataWriter(); 00068 ~vtkXMLStructuredDataWriter(); 00069 00070 // Writing drivers defined by subclasses. 00071 virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent); 00072 virtual void WriteAppendedPiece(int index, vtkIndent indent); 00073 virtual void WriteAppendedPieceData(int index); 00074 virtual void WriteInlinePiece(vtkIndent indent); 00075 virtual void GetInputExtent(int* extent)=0; 00076 00077 virtual int WriteHeader(); 00078 virtual int WriteAPiece(); 00079 virtual int WriteFooter(); 00080 00081 virtual void AllocatePositionArrays(); 00082 virtual void DeletePositionArrays(); 00083 00084 virtual int WriteInlineMode(vtkIndent indent); 00085 vtkIdType GetStartTuple(int* extent, vtkIdType* increments, 00086 int i, int j, int k); 00087 void CalculatePieceFractions(float* fractions); 00088 00089 void SetInputUpdateExtent(int piece); 00090 int ProcessRequest(vtkInformation* request, 00091 vtkInformationVector** inputVector, 00092 vtkInformationVector* outputVector); 00093 00094 vtkSetVector6Macro(InternalWriteExtent, int); 00095 00096 // The extent of the input to write, as specified by user 00097 int WriteExtent[6]; 00098 00099 // The actual extent of the input to write. 00100 int InternalWriteExtent[6]; 00101 00102 // Number of pieces used for streaming. 00103 int NumberOfPieces; 00104 00105 int WritePiece; 00106 00107 float* ProgressFractions; 00108 00109 int CurrentPiece; 00110 00111 int GhostLevel; 00112 00113 vtkTypeInt64* ExtentPositions; 00114 00115 // Appended data offsets of point and cell data arrays. 00116 // Store offset position (add TimeStep support) 00117 OffsetsManagerArray *PointDataOM; 00118 OffsetsManagerArray *CellDataOM; 00119 00120 private: 00121 vtkXMLStructuredDataWriter(const vtkXMLStructuredDataWriter&); // Not implemented. 00122 void operator=(const vtkXMLStructuredDataWriter&); // Not implemented. 00123 }; 00124 00125 #endif