VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkXdmfHeavyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXdmfHeavyData.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 =========================================================================*/
15 // VTK-HeaderTest-Exclude: vtkXdmfHeavyData.h
16 
17 #ifndef __vtkXdmfHeavyData_h
18 #define __vtkXdmfHeavyData_h
19 
20 #include "XdmfDataItem.h"
21 #include "XdmfGrid.h" //won't compile without it
22 #include "vtkIOXdmf2Module.h" // For export macro
23 
24 class vtkAlgorithm;
25 class vtkDataArray;
26 class vtkDataObject;
27 class vtkDataSet;
28 class vtkImageData;
30 class vtkPoints;
31 class vtkRectilinearGrid;
32 class vtkStructuredGrid;
34 class vtkXdmfDomain;
35 
36 // vtkXdmfHeavyData helps in reading heavy data from Xdmf and putting that into
37 // vtkDataObject subclasses.
39 {
40  vtkXdmfDomain* Domain;
41  XdmfDataItem DataItem;
42  vtkAlgorithm* Reader;
43 public:
44  // These must be set before using this class.
45  int Piece;
48  int Extents[6]; // < these are original extents without the stride taken in
49  // consideration
50  int Stride[3];
51  XdmfFloat64 Time;
52 
53 public:
56 
57  // Description:
58  vtkDataObject* ReadData(XdmfGrid* xmfGrid);
59 
60  // Description:
61  vtkDataObject* ReadData();
62 
63  // Description:
64  // Returns the VTKCellType for the given xdmf topology. Returns VTK_EMPTY_CELL
65  // on error and VTK_NUMBER_OF_CELL_TYPES for XDMF_MIXED.
66  static int GetVTKCellType(XdmfInt32 topologyType);
67 
68  // Description:
69  // Returns the number of points per cell. -1 for error. 0 when no fixed number
70  // of points possible.
71  static int GetNumberOfPointsPerCell(int vtk_cell_type);
72 
73 private:
74  // Description:
75  // Read a temporal collection.
76  vtkDataObject* ReadTemporalCollection(XdmfGrid* xmfTemporalCollection);
77 
78  // Description:
79  // Read a spatial-collection or a tree.
80  vtkDataObject* ReadComposite(XdmfGrid* xmfColOrTree);
81 
82  // Description:
83  // Read a non-composite grid. Note here uniform has nothing to do with
84  // vtkUniformGrid but to what Xdmf's GridType="Uniform".
85  vtkDataObject* ReadUniformData(XdmfGrid* xmfGrid);
86 
87  // Description:
88  // Reads the topology and geometry for an unstructured grid. Does not read any
89  // data attributes or geometry.
90  vtkDataObject* ReadUnstructuredGrid(XdmfGrid* xmfGrid);
91 
92  // Description:
93  // Read the image data. Simply initializes the extents and origin and spacing
94  // for the image, doesn't really read any attributes including the active
95  // point attributes.
96  vtkImageData* RequestImageData(XdmfGrid* xmfGrid, bool use_uniform_grid);
97 
98  // Description:
99  // Reads the geometry and topology for a vtkStructuredGrid.
100  vtkStructuredGrid* RequestStructuredGrid(XdmfGrid* xmfGrid);
101 
102  // Description:
103  // Reads the geometry and topology for a vtkRectilinearGrid.
104  vtkRectilinearGrid* RequestRectilinearGrid(XdmfGrid* xmfGrid);
105 
106  // Description:
107  // Reads geometry for vtkUnstructuredGrid or vtkStructuredGrid i.e. of
108  // vtkPointSet subclasses. The extents only make sense when reading
109  // vtkStructuredGrid. If non-null, then the only the points for the sub-grid
110  // are read.
111  vtkPoints* ReadPoints(XdmfGeometry* xmfGeometry,
112  int *update_extents=NULL,
113  int *whole_extents=NULL);
114 
115  // Description:
116  // Read attributes.
117  bool ReadAttributes(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
118  int* update_extents=0);
119 
120  // Description:
121  // Reads an attribute.
122  // If update_extents are non-null, then we are reading structured attributes
123  // and we read only the sub-set specified by update_extents.
124  vtkDataArray* ReadAttribute(XdmfAttribute* xmfAttribute,
125  int data_dimensionality, int* update_extents=0);
126 
127  // Description:
128  // Read sets that mark ghost cells/nodes and then create attribute arrays for
129  // marking the cells as such.
130  bool ReadGhostSets(vtkDataSet* ds, XdmfGrid* xmfGrid,
131  int* update_extents=0);
132 
133  vtkMultiBlockDataSet* ReadSets(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
134  int *update_extents=0);
135 
136  // Description:
137  // Used when reading node-sets.
138  // Creates a new dataset with points with given ids extracted from the input
139  // dataset.
140  vtkDataSet* ExtractPoints(XdmfSet* xmfSet, vtkDataSet* dataSet);
141 
142  // Description:
143  // Used when reading cell-sets.
144  // Creates a new dataset with cells with the given ids extracted from the
145  // input dataset.
146  vtkDataSet* ExtractCells(XdmfSet* xmfSet, vtkDataSet* dataSet);
147 
148  // Description:
149  // Used when reading face-sets.
150  // Creates a new dataset with faces selected by the set, extracting them from
151  // the input dataset.
152  vtkDataSet* ExtractFaces(XdmfSet* xmfSet, vtkDataSet* dataSet);
153 
154  // Description:
155  // Used when reading edge-sets.
156  // Creates a new dataset with egdes selected by the set, extracting them from
157  // the input dataset.
158  vtkDataSet* ExtractEdges(XdmfSet* xmfSet, vtkDataSet* dataSet);
159 
160 };
161 
162 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
#define VTKIOXDMF2_EXPORT
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
topologically regular array of data
Composite dataset that organizes datasets into blocks.
general representation of visualization data
Definition: vtkDataObject.h:64
represent and manipulate 3D points
Definition: vtkPoints.h:39