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 =========================================================================*/
23 #ifndef vtkXMLStructuredDataWriter_h
24 #define vtkXMLStructuredDataWriter_h
25 
26 #include "vtkIOXMLModule.h" // For export macro
27 #include "vtkXMLWriter.h"
28 
29 class vtkAbstractArray;
30 class vtkInformation;
32 
33 class VTKIOXML_EXPORT vtkXMLStructuredDataWriter : public vtkXMLWriter
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
44  vtkSetMacro(NumberOfPieces, int);
45  vtkGetMacro(NumberOfPieces, int);
47 
49 
53  vtkSetMacro(WritePiece, int);
54  vtkGetMacro(WritePiece, int);
56 
58 
61  vtkSetMacro(GhostLevel, int);
62  vtkGetMacro(GhostLevel, int);
64 
66 
71  vtkSetVector6Macro(WriteExtent, int);
72  vtkGetVector6Macro(WriteExtent, int);
74 
75 protected:
77  ~vtkXMLStructuredDataWriter() override;
78 
79  // Writing drivers defined by subclasses.
80  void WritePrimaryElementAttributes(ostream &os, vtkIndent indent) override;
81  virtual void WriteAppendedPiece(int index, vtkIndent indent);
82  virtual void WriteAppendedPieceData(int index);
83  virtual void WriteInlinePiece(vtkIndent indent);
84  virtual void GetInputExtent(int* extent)=0;
85 
86  virtual int WriteHeader();
87  virtual int WriteAPiece();
88  virtual int WriteFooter();
89 
90  virtual void AllocatePositionArrays();
91  virtual void DeletePositionArrays();
92 
93  virtual int WriteInlineMode(vtkIndent indent);
94  vtkIdType GetStartTuple(int* extent, vtkIdType* increments,
95  int i, int j, int k);
96  void CalculatePieceFractions(float* fractions);
97 
98  void SetInputUpdateExtent(int piece);
99  int ProcessRequest(vtkInformation* request,
100  vtkInformationVector** inputVector,
101  vtkInformationVector* outputVector) override;
102 
103  vtkSetVector6Macro(InternalWriteExtent, int);
104 
105  static vtkIdType GetNumberOfValues(vtkDataSet* input);
106 
107  // The extent of the input to write, as specified by user
108  int WriteExtent[6];
109 
110  // The actual extent of the input to write.
111  int InternalWriteExtent[6];
112 
113  // Number of pieces used for streaming.
115 
117 
119 
121 
123 
124  vtkTypeInt64* ExtentPositions;
125 
126  // Appended data offsets of point and cell data arrays.
127  // Store offset position (add TimeStep support)
130 
131 private:
133  void operator=(const vtkXMLStructuredDataWriter&) = delete;
134 };
135 
136 #endif
Store vtkAlgorithm input/output information.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
Abstract superclass for all arrays.
int vtkIdType
Definition: vtkType.h:347
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Superclass for VTK XML structured data writers.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.