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 "vtkIOXMLModule.h" // For export macro
26 #include "vtkXMLWriter.h"
27 
28 class vtkAbstractArray;
30 class vtkInformation;
32 
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40 
42  vtkSetMacro(NumberOfPieces, int);
43  vtkGetMacro(NumberOfPieces, int);
45 
47 
50  vtkSetVector6Macro(WriteExtent, int);
51  vtkGetVector6Macro(WriteExtent, int);
53 
55 
56  virtual void SetExtentTranslator(vtkExtentTranslator*);
57  vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
59 
60 protected:
63 
64  // Writing drivers defined by subclasses.
65  virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
66  virtual void WriteAppendedPiece(int index, vtkIndent indent);
67  virtual void WriteAppendedPieceData(int index);
68  virtual void WriteInlinePiece(vtkIndent indent);
69  virtual void GetInputExtent(int* extent)=0;
70 
71  virtual int WriteHeader();
72  virtual int WriteAPiece();
73  virtual int WriteFooter();
74 
75  virtual void AllocatePositionArrays();
76  virtual void DeletePositionArrays();
77 
78  void SetupExtentTranslator();
79  vtkAbstractArray* CreateExactExtent(vtkAbstractArray* array, int* inExtent,
80  int* outExtent, int isPoint);
81  virtual int WriteInlineMode(vtkIndent indent);
82  vtkIdType GetStartTuple(int* extent, vtkIdType* increments,
83  int i, int j, int k);
84  void CalculatePieceFractions(float* fractions);
85 
86  // Define utility methods required by vtkXMLWriter.
89 
90  void SetInputUpdateExtent(int piece);
91  int ProcessRequest(vtkInformation* request,
92  vtkInformationVector** inputVector,
93  vtkInformationVector* outputVector);
94 
95  vtkSetVector6Macro(InternalWriteExtent, int);
96 
97  // The extent of the input to write, as specified by user
98  int WriteExtent[6];
99 
100  // The actual extent of the input to write.
101  int InternalWriteExtent[6];
102 
103  // Number of pieces used for streaming.
105 
106  // Translate piece number to extent.
108 
110 
112 
113  // Appended data offsets of point and cell data arrays.
114  // Store offset position (add TimeStep support)
117 
118 private:
119  vtkXMLStructuredDataWriter(const vtkXMLStructuredDataWriter&); // Not implemented.
120  void operator=(const vtkXMLStructuredDataWriter&); // Not implemented.
121 };
122 
123 #endif
GLuint index
Definition: vtkgl.h:11983
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
Generates a structured extent from unstructured.
int vtkIdType
Definition: vtkType.h:268
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
Superclass for VTK XML structured data writers.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKIOXML_EXPORT
virtual vtkAbstractArray * CreateArrayForPoints(vtkAbstractArray *inArray)
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
virtual vtkAbstractArray * CreateArrayForCells(vtkAbstractArray *inArray)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
#define vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:350
Store zero or more vtkInformation instances.
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:370
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69