VTK
vtkXMLStructuredDataWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLStructuredDataWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef __vtkXMLStructuredDataWriter_h
23 #define __vtkXMLStructuredDataWriter_h
24 
25 #include "vtkXMLWriter.h"
26 
27 class vtkAbstractArray;
29 class vtkInformation;
31 
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent);
37 
39 
41  vtkSetMacro(NumberOfPieces, int);
42  vtkGetMacro(NumberOfPieces, int);
44 
46 
49  vtkSetVector6Macro(WriteExtent, int);
50  vtkGetVector6Macro(WriteExtent, int);
52 
54 
55  virtual void SetExtentTranslator(vtkExtentTranslator*);
56  vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
58 
59 protected:
62 
63  // Writing drivers defined by subclasses.
64  virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
65  virtual void WriteAppendedPiece(int index, vtkIndent indent);
66  virtual void WriteAppendedPieceData(int index);
67  virtual void WriteInlinePiece(vtkIndent indent);
68  virtual void GetInputExtent(int* extent)=0;
69 
70  virtual int WriteHeader();
71  virtual int WriteAPiece();
72  virtual int WriteFooter();
73 
74  virtual void AllocatePositionArrays();
75  virtual void DeletePositionArrays();
76 
77  void SetupExtentTranslator();
78  vtkAbstractArray* CreateExactExtent(vtkAbstractArray* array, int* inExtent,
79  int* outExtent, int isPoint);
80  virtual int WriteInlineMode(vtkIndent indent);
81  vtkIdType GetStartTuple(int* extent, vtkIdType* increments,
82  int i, int j, int k);
83  void CalculatePieceFractions(float* fractions);
84 
85  // Define utility methods required by vtkXMLWriter.
88 
89  void SetInputUpdateExtent(int piece);
90  int ProcessRequest(vtkInformation* request,
91  vtkInformationVector** inputVector,
92  vtkInformationVector* outputVector);
93 
94  vtkSetVector6Macro(InternalWriteExtent, int);
95 
96  // The extent of the input to write, as specified by user
97  int WriteExtent[6];
98 
99  // The actual extent of the input to write.
100  int InternalWriteExtent[6];
101 
102  // Number of pieces used for streaming.
104 
105  // Translate piece number to extent.
107 
109 
111 
112  // Appended data offsets of point and cell data arrays.
113  // Store offset position (add TimeStep support)
116 
117 private:
118  vtkXMLStructuredDataWriter(const vtkXMLStructuredDataWriter&); // Not implemented.
119  void operator=(const vtkXMLStructuredDataWriter&); // Not implemented.
120 };
121 
122 #endif