VTK
vtkXMLUnstructuredDataWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLUnstructuredDataWriter.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 __vtkXMLUnstructuredDataWriter_h
23 #define __vtkXMLUnstructuredDataWriter_h
24 
25 #include "vtkXMLWriter.h"
26 
27 class vtkPointSet;
28 class vtkCellArray;
29 class vtkDataArray;
30 class vtkIdTypeArray;
32 
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40 
42  vtkSetMacro(NumberOfPieces, int);
43  vtkGetMacro(NumberOfPieces, int);
45 
47 
49  vtkSetMacro(WritePiece, int);
50  vtkGetMacro(WritePiece, int);
52 
54 
55  vtkSetMacro(GhostLevel, int);
56  vtkGetMacro(GhostLevel, int);
58 
59  // See the vtkAlgorithm for a desciption of what these do
63 
64 protected:
67 
68  vtkPointSet* GetInputAsPointSet();
69  virtual const char* GetDataSetName()=0;
70  virtual void SetInputUpdateExtent(int piece, int numPieces,
71  int ghostLevel);
72 
73  virtual int WriteHeader();
74  virtual int WriteAPiece();
75  virtual int WriteFooter();
76 
77  virtual void AllocatePositionArrays();
78  virtual void DeletePositionArrays();
79 
80  virtual int WriteInlineMode(vtkIndent indent);
81  virtual void WriteInlinePieceAttributes();
82  virtual void WriteInlinePiece(vtkIndent indent);
83 
84  virtual void WriteAppendedPieceAttributes(int index);
85  virtual void WriteAppendedPiece(int index, vtkIndent indent);
86  virtual void WriteAppendedPieceData(int index);
87 
88  void WriteCellsInline(const char* name, vtkCellArray* cells,
89  vtkDataArray* types, vtkIndent indent);
90 
91  // New API with face infomration for polyhedron cell support.
92  void WriteCellsInline(const char* name, vtkCellArray* cells,
93  vtkDataArray* types, vtkIdTypeArray* faces,
94  vtkIdTypeArray* faceOffsets, vtkIndent indent);
95 
96  void WriteCellsAppended(const char* name, vtkDataArray* types,
97  vtkIndent indent, OffsetsManagerGroup *cellsManager);
98 
99  void WriteCellsAppendedData(vtkCellArray* cells, vtkDataArray* types,
100  int timestep, OffsetsManagerGroup *cellsManager);
101 
102  // New API with face infomration for polyhedron cell support.
103  void WriteCellsAppendedData(vtkCellArray* cells, vtkDataArray* types,
104  vtkIdTypeArray* faces,vtkIdTypeArray* faceOffsets,
105  int timestep, OffsetsManagerGroup *cellsManager);
106 
107  void ConvertCells(vtkCellArray* cells);
108 
109  // For polyhedron support, convertion results are stored in Faces and FaceOffsets
110  void ConvertFaces(vtkIdTypeArray* faces, vtkIdTypeArray* faceOffsets);
111 
112  // Get the number of points/cells. Valid after Update has been
113  // invoked on the input.
114  virtual vtkIdType GetNumberOfInputPoints();
115  virtual vtkIdType GetNumberOfInputCells()=0;
116  void CalculateDataFractions(float* fractions);
117  void CalculateCellFractions(float* fractions, vtkIdType typesSize);
118 
119  // Number of pieces used for streaming.
121 
122  // Which piece to write, if not all.
124 
125  // The ghost level on each piece.
127 
128  // Positions of attributes for each piece.
129  unsigned long* NumberOfPointsPositions;
130 
131  // For TimeStep support
135 
136  // Hold the new cell representation arrays while writing a piece.
139 
141 
142  // Hold the face arrays for polyhedron cells.
145 
146 private:
148  void operator=(const vtkXMLUnstructuredDataWriter&); // Not implemented.
149 };
150 
151 #endif
virtual const char * GetDataSetName()=0
Store vtkAlgorithm input/output information.
Superclass for VTK XML unstructured data writers.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:40
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:50
a simple class to control print indentation
Definition: vtkIndent.h:37
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
void PrintSelf(ostream &os, vtkIndent indent)
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
object to represent cell connectivity
Definition: vtkCellArray.h:48
Store zero or more vtkInformation instances.
#define VTK_IO_EXPORT